package com.ssm.basis.configuration;

import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScan.Filter;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ControllerAdvice;

import static com.ssm.basis.configuration.ConfigurationPackage.ROOT_PACKAGE;
import static org.springframework.context.annotation.FilterType.ANNOTATION;

/**
 * 不扫描 web 组件
 */
// @EnableAsync // 开启异步
@EnableCaching // 开启缓存
// @EnableScheduling // 开启定时任务
@ComponentScan(basePackages = ROOT_PACKAGE, excludeFilters = @Filter(classes = {
        Controller.class, ControllerAdvice.class
}, type = ANNOTATION))
@PropertySource(value = "${spring.application.name:application}-${spring.profiles.active:default}.properties", ignoreResourceNotFound = true)
@Configuration(proxyBeanMethods = false)
class NonWebConfiguration {
}
